<template>
  <!-- 顶部栏 -->
  <div class="header_box">
    <span @click="goHome">首页</span>
    <span>您好，用户</span>
    <span @click="loginOut">退出</span>
  </div>
</template>

<script>
var self;
export default {
  name: "",
  data() {
    return {};
  },
  created() {
    self = this;
  },
  methods: {
    loginOut() {
      this.$confirm("您确定要退出登录吗？", "操作确认", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(() => {
        localStorage.clear();
        location.reload();
      });
    },
    goHome(){
      this.$router.push('/')
    }
  }
};
</script>
<style scoped lang="scss">
</style>
